import numpy as np

t2 = np.arange(12).reshape(3,4)

print(t2)

#numpy的bool索引
# t2[t2<10] = 3
# print(t2)

#三元运算符
# t3 = np.where(t2<=3,5,10)
# print(t3)

print(np.sum(t2,axis=0))

t2 = t2.astype("float")
t2[2,2] = np.nan
print(t2)

print(np.count_nonzero(t2!=t2))
print(np.count_nonzero(np.isnan(t2)))

